\title{Troubleshooting}

\subsection{Troubleshooting}

\subsubsection{Basic Installation}

Edward depends on

\begin{itemize}
  \item NumPy (>=1.7)
  \item Six (>=1.1.0)
  \item TensorFlow (>=1.2.0rc0)
\end{itemize}

Installing \texttt{edward} by default also installs \texttt{numpy} and
\texttt{six} if they are unavailable (or out-of-date).

Installing \texttt{edward} does not automatically install or update
TensorFlow. We recommend installing it via

\begin{lstlisting}[language=JSON]
pip install tensorflow
\end{lstlisting}

To use Edward with GPUs, install \texttt{tensorflow-gpu} instead of
\texttt{tensorflow} as

\begin{lstlisting}[language=JSON]
pip install tensorflow-gpu
\end{lstlisting}

See TensorFlow's
\href{https://www.tensorflow.org/install/}{installation instructions}
for details, including how to set up NVIDIA software for TensorFlow with GPUs.

\subsubsection{Full Installation}

Edward has optional features that depend on external packages.

\begin{itemize}
  \item Any examples using real data sets typically require
  \href{https://github.com/edwardlib/observations/}{Observations} (>=0.1.2)
\begin{lstlisting}[language=JSON]
pip install observations
\end{lstlisting}
Observations lets you load an extensive collection of data sets with
minimal effort under a one-line interface. Observations was originally
developed for Edward and it has since become a standalone library for
general machine learning.
  \item Neural networks are supported through any library operating
    on TensorFlow. For example:
  \texttt{tf.layers},
  \href{http://keras.io}{Keras} (>=1.0)
\begin{lstlisting}[language=JSON]
pip install keras==2.0.4
\end{lstlisting}
  and
  \href{https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim}{TensorFlow Slim}
  (native in TensorFlow).

Note that for Keras 2.0.5 and beyond, all neural net layer transformations cannot be directly applied on random variables anymore. For example, if \texttt{x} is a \texttt{ed.RandomVariable} object, one must call \texttt{tf.convert\_to\_tensor} before applying it to a layer transformation, \texttt{Dense(256)(tf.convert\_to\_tensor(x))}.  See \href{https://github.com/fchollet/keras/issues/6979}{here} for more details.
  \item Notebooks require
  \href{http://jupyter.org}{Jupyter} (>=1.0.0)
\begin{lstlisting}[language=JSON]
pip install jupyter
\end{lstlisting}
  \item Visualization requires
  \href{http://matplotlib.org}{Matplotlib} (>=1.3),
  \href{https://pillow.readthedocs.io}{Pillow} (>=3.4.2), and
  \href{https://seaborn.pydata.org}{Seaborn} (>=0.3.1)
\begin{lstlisting}[language=JSON]
pip install matplotlib
pip install pillow
pip install seaborn
\end{lstlisting}
\end{itemize}
